/*
    SUSAN® - Sole of Unix Save ANything

      Copyright (C) 2011-2016 Skyatlas Co. LTD

   

   
*/

#ifndef BAREOS_LIB_MESSAGE_DESTINATION_INFO_H_
#define BAREOS_LIB_MESSAGE_DESTINATION_INFO_H_

#include "lib/message_severity.h"

enum class MessageDestinationCode : int
{
  kUndefined = 0,
  kSyslog = 1,     // Send msg to syslog
  kMail,           // Email group of messages
  kFile,           // Write messages to a file
  kAppend,         // Append messages to a file
  kStdout,         // Print messages
  kStderr,         // Print messages to stderr
  kDirector,       // Send message to the Director
  kOperator,       // Email a single message to the operator
  kConsole,        // Send msg to UserAgent or console
  KMailOnError,    // Email messages if job errors
  kMailOnSuccess,  // Email messages if job succeeds
  kCatalog         // Store message into catalog
};


struct MessageDestinationInfo {
 public:
  MessageDestinationInfo() = default;
  ~MessageDestinationInfo() = default;
  MessageDestinationInfo(const MessageDestinationInfo& other) = default;

  FILE* file_pointer_ = nullptr;
  MessageDestinationCode dest_code_ = MessageDestinationCode::kUndefined;
  int max_len_ = 0;                 /* Max mail line length */
  int syslog_facility_ = 0;         /* Syslog Facility */
  char msg_types_[NR_MSG_TYPES]{0}; /* Message type mask */
  std::string where_;               /* Filename/program name */
  std::string mail_cmd_;            /* Mail command */
  std::string timestamp_format_;    /* used in logging messages */
  std::string mail_filename_;       /* Unique mail filename */
};

#endif /* BAREOS_LIB_MESSAGE_DESTINATION_INFO_H_ */
